package object.package1;
class Student{
    private String name;

}
class Book{
    public String title;
}
class MyArray{
    private Object[] data=new Object[10];

    public Object get(int index) {
        return data[index];
    }

    public void set(int index , Object value) {
        data[index] = value;
    }
}
public class Test2 {
    public static void main(String[] args) {
        MyArray array = new MyArray();
        array.set(0,new Book());
        array.set(1,new Student());
        array.set(2,new String("Hello"));
        Object obj = array.get(0);
        Book book= (Book) obj;
        System.out.println(book.title);
    }

}
